cc.Class({
    extends: cc.Component,

    properties: {
        itemNode: cc.Node,
    },

    onLoad () {
        this.itemBox = this.itemNode.parent;
        this.itemNode.parent = null;
    },

    init(data) {
        for(var i in data) {
            var node = cc.instantiate(this.itemNode);
            var item = node.getComponent('ShopItemLeaf');
            node.parent = this.itemBox;
            item.init(data[i]);
        }
    },

});
